        local HttpService = game:GetService("HttpService") 
        local log = function(s)
            local success, err = pcall(function()appendfile("log.txt", string.format("[%s] %s\n", os.date("%Y-%m-%d %H:%M:%S"), tostring(s)))end)
            if not success then
                writefile("log.txt", string.format("[%s] %s\n", os.date("%Y-%m-%d %H:%M:%S"), tostring(s)))
            end
        end
        local ReplicatedStorage = game:GetService("ReplicatedStorage")
        local Trade = ReplicatedStorage:WaitForChild("Trade")
        
        Trade:WaitForChild("UpdateTrade").OnClientEvent:Connect(function(data)
            print("【🟡 UpdateTrade 事件捕获】")
            print("data type",typeof(data))
            local json = HttpService:JSONEncode(data)
            log("UpdateTrade:" .. json)
        end)
        
        local mt = getrawmetatable(game)
        setreadonly(mt, false)
        local oldNamecall = mt.__namecall
        local target_list = {
        ["GetRequest"] = true,
        ["AcceptRequest"] = true,
        ["DeclineRequest"] = true,
        ["AcceptTrade"] = true,
        ["DeclineTrade"] = true,
        ["StartTrade"] = true,
        ["OfferItem"] = true,
        ["UpdateOffers"] = true,
        ["RemoveOffer"] = true,
        ["EndTrade"] = true,
        ["CancelRequest"] = true,
        ["CompleteTrade"] = true,
        ["SendRequest"] = true,
        ["UpdateTrade"] = true,
        ["CancelAccept"] = true,
        ["GetTradeStatus"] = true,
        ["SetRequestsEnabled"] = true,
        ["RequestSent"] = true
        }
        mt.__namecall = function(self, ...)
            local method = getnamecallmethod()
            local args = {...}
            local remoteName = tostring(self)
        
            if target_list[remoteName] and (method == "FireServer" or method == "InvokeServer") then
                log(string.format("Trade ==>%s:%s",remoteName,method))
                for i, arg in ipairs(args) do
                    if typeof(arg) == "table" then
                        local json = HttpService:JSONEncode(arg)
                        log(string.format("参数序号[%d] 类型: %s 值:%s", i, tostring(typeof(arg)), json))
                    else 
                        log(string.format("参数序号[%d] 类型: %s 值:%s", i, tostring(typeof(arg)), tostring(arg)))
                    end
                end
            end
        --  return oldNamecall(self, unpack(args))
            local results = {oldNamecall(self, unpack(args))}
            if target_list[remoteName] and method == "InvokeServer" then
                log(string.format("Trade ==>%s:%s 返回值数量: %s",remoteName,method,#results))
                for i, res in ipairs(results) do
                    if typeof(res) == "table" then
                        local json = HttpService:JSONEncode(res)
                        log(string.format("%s返回值[%d] 类型: %s 值:%s", remoteName,i, tostring(typeof(res)), json))
                    else
                        log(string.format("%s返回值[%d] 类型: %s 值:%s", remoteName,i, tostring(typeof(res)), tostring(res)))
                    end
                end
            end
        
            return unpack(results)
        end
        
        log("✅ [交易拦截器] 启动成功，请执行一次交易流程来抓包")